package com.back.component;

import cn.dev33.satoken.stp.StpInterface;
import com.back.baseModule.entity.SysUser;
import com.back.baseModule.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 自定义权限验证接口扩展
 */
@Component
public class StpInterfaceImpl implements StpInterface {
    @Autowired
    private SysUserService sysUserService;
    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        SysUser sysUser = new SysUser();
        sysUser.setId(loginId.toString());
        SysUser adminUser = sysUserService.findByCondition(sysUser);
        //AdminUser adminUser = adminService.getAdminById(Convert.toLong(loginId));
        //return adminUser.getRole().getPermissionList();
        return null;
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
       // AdminUser adminUser = adminService.getAdminById(Convert.toLong(loginId));
        //return Collections.singletonList(adminUser.getRole().getName());
        return null;
    }
}
